<h3>text</h3>
<div style="float:left;">
    <div id="kineticjs_image"></div>
</div>

<div style="float:right;width:50%;">
    <textarea style="width: 90%;height: 300px;" id="code_kineticjs_image">
   var stage = new Kinetic.Stage({
        container: 'kineticjs_image',
        width: 578,
        height: 200
      });
      var layer = new Kinetic.Layer();

      var imageObj = new Image();
      imageObj.onload = function() {
        var yoda = new Kinetic.Image({
          x: 200,
          y: 50,
          image: imageObj,
          width: 106,
          height: 118
        });

        // add the shape to the layer
        layer.add(yoda);

        // add the layer to the stage
        stage.add(layer);
      };
      imageObj.src = '/images/4.png';
    
    </textarea><br />
    <input type="button" value="run" onclick="run_code('#code_kineticjs_image')" />
    
</div>
<script type="text/javascript">
<!--
	$(function(){
	   run_code('#code_kineticjs_image');
	})
-->
</script>
